package com.ruoyi.forum.config;

import org.dozer.DozerBeanMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @Description:dozer配置类
 * @Author: Hoda
 * @Date: Create in 2018-07-30
 * @Modified By:
 * @Modified Date:
 */
@Configuration
public class DozerConfig {

    @Bean
    public DozerBeanMapper dozerBean() {
        List<String> mappingFiles = Collections.singletonList(
                "dozer_mapping.xml"
        );

        DozerBeanMapper dozerBean = new DozerBeanMapper();
        dozerBean.setMappingFiles(mappingFiles);
        return dozerBean;
    }
}
